import groovy.xml.XmlUtil

//sw = new StringWriter()
//
//builder = new MarkupBuilder(sw)
//
//carlist = ['name': 'car1', 'model': 'm1']
//dealerlist = ['name':'dealer']
//
//builder.cars{
//    carlist.each{
//        car(name: 'name', model: 'model')
//    }
//}
//
//println sw.toString()

//xml = '''
//<cars>
//  <car name='name' model='model' />
//  <car name='name' model='model' />
//</cars>
//'''
//
//def root = new XmlSlurper().parseText(xml)
//root.appendNode{
//    dealers{
//        dealerlist.each {
//            dealer(name: 'dealername')
//        }
//
//    }
//}
//def outputBuilder = new StreamingMarkupBuilder()
//String result = outputBuilder.bind{ mkp.yield root }
//println result

//def model = new ReportTemplate()
//def writer = new StringWriter()
//XmlUtil.serialize(model.getTemplateNode(), writer)
//println writer.toString()


//def root="<root/>"
//def l1 = "<level1/>"
//def l2 = "<level2/>"
//
//def dom = new XmlSlurper().parseText(root)
//dom.appendNode(new XmlSlurper().parseText(l1))
//
//dom = new XmlSlurper().parseText(XmlUtil.serialize(dom))
//dom.level1.appendNode(new XmlSlurper().parseText(l2))
//
//println XmlUtil.serialize(dom)


def root="<root/>"
def l1 = "<level1/>"
def l2 = "<level2/>"

def dom = new XmlSlurper(false,false,false).parseText(root)
//
//def row = new XmlSlurper().parseText( l1 )
//row << new XmlSlurper().parseText( l2 )
//dom << row

println XmlUtil.serialize(dom).readLines()[1..-1].join('\n')